import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TaskDailyConfigRefVO, TaskDailyConfigRefForm, TaskDailyConfigRefQuery } from '@/api/config/taskDailyConfigRef/types';

/**
 * 查询日常任务配置关联列表
 * @param query
 * @returns {*}
 */

export const listTaskDailyConfigRef = (query?: TaskDailyConfigRefQuery): AxiosPromise<TaskDailyConfigRefVO[]> => {
  return request({
    url: '/config/taskDailyConfigRef/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询日常任务配置关联详细
 * @param id
 */
export const getTaskDailyConfigRef = (id: string | number): AxiosPromise<TaskDailyConfigRefVO> => {
  return request({
    url: '/config/taskDailyConfigRef/' + id,
    method: 'get'
  });
};

/**
 * 新增日常任务配置关联
 * @param data
 */
export const addTaskDailyConfigRef = (data: TaskDailyConfigRefForm) => {
  return request({
    url: '/config/taskDailyConfigRef',
    method: 'post',
    data: data
  });
};

/**
 * 修改日常任务配置关联
 * @param data
 */
export const updateTaskDailyConfigRef = (data: TaskDailyConfigRefForm) => {
  return request({
    url: '/config/taskDailyConfigRef',
    method: 'put',
    data: data
  });
};

/**
 * 删除日常任务配置关联
 * @param id
 */
export const delTaskDailyConfigRef = (id: string | number | Array<string | number>) => {
  return request({
    url: '/config/taskDailyConfigRef/' + id,
    method: 'delete'
  });
};
